package com.caigou.bean.cms.entity;

import com.caigou.bean.vo.KeyValueVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;
import java.util.List;

@Data
//@Document(indexName = "cms-alias", type = "cms")
@Document(indexName = "cms-first", type = "cms")
public class EsArticle {

    @Id
    private String articleId;//数据唯一ID(雪花唯一ID18位)

    @Field(type = FieldType.Text, index = false)
    private String articleUserId;//创建人ID(草稿箱获取条件)

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String articleTitle;//内文标题

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String searchTitle;//查询专用标题  将多个标题拼接起来,用逗号分隔  需要分词

    @Field(type = FieldType.Text)
    private String articleAuthor;//作者(作者表id值列表,逗号拼接,预设各式个数不限)

    @Field(type = FieldType.Long, index = false)
    private Integer articlePromoterStatus;//是否启用作者推荐(0不启用1启用)

    @Field(type = FieldType.Long, index = false)
    private Integer articlePromoter;//当前文章的推荐作者(由本表中的作者列表中筛选)

    @Field(type = FieldType.Text, index = false)
    private String articleScout;//约稿人

    @Field(type = FieldType.Text, index = false)
    private String articleEditor;//编辑

    @Field(type = FieldType.Text, index = false)
    private String articleSource;//来源

    @Field(type = FieldType.Text, index = false)
    private String articleKeyWord;//关键字(关键词表id值列表,逗号拼接)

    @Field(type = FieldType.Text, index = false)
    private Integer articlePaperStatus;//报纸发布状态(-1未选择、0不需要刊登、1需要刊登-已刊登、2需要刊登-未刊登)

    @Field(type = FieldType.Text, index = false)
    private Integer articleWeChatStatus;//微信发布状态(-1未选择、0不需要刊登、1需要刊登-已刊登、2需要刊登-未刊登)

    @Field(type = FieldType.Long, index = false)
    private Integer articleEBookStatus;//书籍/电子书发布状态(发布方式待定)

    @Field(type = FieldType.Long, index = false)
    private Integer articleOutLinkStatus;//当前文章是否使用外联作为跳转地址(0不启用1启用(启用之后点击该文章跳转到外部连接地址))

    @Field(type = FieldType.Text, index = false)
    private String articleOutLink;//跳转外部连接(如果外部连接状态开启，跳转到外部的地址)

    @Field(type = FieldType.Long, index = false)
    private Integer articleInfoStatus;//简介字段是否在正文前显示(0不显示1显示)

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String articleInfo;//文本简介(不带排版，可换行)

    @Field(type = FieldType.Long, index = false)
    private Integer articleAnnotationStatus;//专题注释轴启用状态

    @Field(type = FieldType.Text, index = false)
    private String articleUrl;//生成的文章的访问地址

    @Field(type = FieldType.Text)
    private String articleType;//数据类型(1新闻咨询2法律法规3案例点评4图集资讯5政采周报(音频)6亚利聊政采7产品资讯8图书9内控制度10采购文件范本11采购合同范本12处理信息库13词库14小专题)

    @Field(type = FieldType.Long, index = false)
    private Integer articleLikeRecommendStatus;//猜你喜欢推荐开启设置(0禁用1启用)

    @Field(type = FieldType.Long, index = false)
    private Integer articleRecommendType;//推荐方式(1自动2手动)

    @Field(type = FieldType.Text, index = false)
    private String articleRecommend;//推荐文章列表逗号分隔(手动方式的时候)

    @Field(type = FieldType.Long, index = false)
    private Integer articleVip;//付费标识(0免费1付费)

    @Field(type = FieldType.Long, index = false)
    private Integer articleVipType;//购买类型(1采币2人民币3双重付费不混合[人民币采币单独定价])前端勾选状态

    @Field(type = FieldType.Long, index = false)
    private Integer articleMoney;//付费价格(人民币)如果付费状态,价格为0前端勾选状态去除

    @Field(type = FieldType.Long, index = false)
    private Integer articlePrice;//付费价格(采币)如果付费状态,价格为0前端勾选状态去除

    @Field(type = FieldType.Long, index = false)
    private Integer articleLikeType;//点赞数量调整(1真实数量2手动调整[取本表字段])

    @Field(type = FieldType.Long, index = false)
    private Integer articleLikeCount;//文章点赞数量(手动调整展示用)

    @Field(type = FieldType.Long, index = false)
    private Integer articleClickCount;//文章点击量(PV点击量)

    @Field(type = FieldType.Long, index = false)
    private Integer articleVisitCount;//文章访问量(UV计算规则)

    @Field(type = FieldType.Text, index = false)
    private String articleCommentId;//评论ID(新增与获取评论的ID)

    @Field(type = FieldType.Long, index = false)
    private Integer articleCommentStatus;//是否开启评论功能(0禁止1启用2跟随频道/栏目)(文章优先级高)

    @Field(type = FieldType.Long, index = false)
    private Integer articleStatus;//发布状态(-1已删除0待审核1审核通过2审核不通过3草稿4审核过程中的草稿)

    @Field(type = FieldType.Text, index = false)
    private String articleShareImage;//文章正文分享图

    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;//创建时间(数据创建时间)

    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;//更新时间(数据更新时间、除发布的更改都更新这个字段)

    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date publicTime;//更新时间(数据更新时间、除发布的更改都更新这个字段)

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String articlePureContent;

    @Field(type = FieldType.Object)
    private List<KeyValueVO> articleKeyWordVOS;//关键词list对象

    @Field(type = FieldType.Object)//t_article_title
    private List<ArticleTitle> articleTitleVOS;//文章多标题list对象


}
